var loginFlag = false;
$(function () {
  //	禁用f5刷新
  //	document.onkeydown = function(e){
  //	    e = window.event || e;
  //	    var keycode = e.keyCode || e.which;
  //	    if( keycode = 116){
  //	        if(window.event){// ie
  //	            try{e.keyCode = 0;}catch(e){}
  //	            e.returnValue = false;
  //	        }else{// ff
  //	            e.preventDefault();
  //	        }
  //	    }
  //	}

  // 判断是否登录，未登录则刷新
  setInterval(function () {
    if (loginFlag) {
      $.ajax({
        url: '/user/out',
        error: function (res) {
          // console.log(res);
          if (res.status == 403) {
            window.location.reload();
          }
        }
      });
    }

  }, 30000);
  var logoClick = 0;
  $(".logo").click(function () {
    logoClick += 1;
    if (logoClick < 6) {
      if (logoClick == 5) {
        closeChrome();
      }
      if (logoClick == 1) {
        setTimeout(function () {
          logoClick = 0;
        }, 2000);
      }
    }
  });

  function closeChrome() {
    var browserName = navigator.appName;
    //        alert(browserName);
    if (browserName == "Netscape") {
      window.open('', '_self', '');
      window.close();
    } else {
      window.close();
    }
  }
  //	var username=GetCookie("username");
  function GetCookie(name) {
    var arg = name + "=";
    var alen = arg.length;
    var clen = document.cookie.length;
    var i = 0;
    while (i < clen) {
      var j = i + alen;
      if (document.cookie.substring(i, j) == arg)
        return GetCookieVal(j);
      i = document.cookie.indexOf(" ", i) + 1;
      if (i == 0) break;
    }
    return null;
  }

  function GetCookieVal(offset) {
    var endstr = document.cookie.indexOf(";", offset);
    if (endstr == -1)
      endstr = document.cookie.length;
    return unescape(document.cookie.substring(offset, endstr));
  }
  var str1 = '';

  function timeToggle(str) {
    str = str.substr(0, 4) + '-' + str.substr(4, 2) + '-' + str.substr(6, 2) + ' ' + str.substr(8, 2) + ':' + str.substr(10, 2) + ':' + str.substr(12, 2);
    return str;
  }
  timeToggle(str1)
  //	头部显示时间
  timeFunc();
  //	左侧日期
  function timeFunc() {
    $(".leftNav .timeDate").text(moment().format("YYYY" + "年" + "MM" + "月" + "DD" + "日"));
    if (moment().format("d") == 0) {
      $(".leftNav .timeWeek").text("星期日");
    } else if (moment().format("d") == 1) {
      $(".leftNav .timeWeek").text("星期一");
    } else if (moment().format("d") == 2) {
      $(".leftNav .timeWeek").text("星期二");
    } else if (moment().format("d") == 3) {
      $(".leftNav .timeWeek").text("星期三");
    } else if (moment().format("d") == 4) {
      $(".leftNav .timeWeek").text("星期四");
    } else if (moment().format("d") == 5) {
      $(".leftNav .timeWeek").text("星期五");
    } else if (moment().format("d") == 6) {
      $(".leftNav .timeWeek").text("星期六");
    }
    $(".leftNav .timeMinute").text(moment().format("HH:mm"));
  }

  setInterval(function () {
    timeFunc();
  }, 1000);
  //登录隐藏
  //    $(".login").hide();
  //警官登录
  //$(".policeIContent").hide();
  //登录loading
  $(".policeIdLoading").hide();
  //登录错误的弹出层
  $(".policePasswordErr").hide();
  //审批
  //    $(".approval").hide();

  //最后提交
  var clothesNum;
  var pantsNum;
  var underwearNum;
  var socksNum;
  var cigaretteNum;
  var towelNum;
  var washNum;
  var washNum1;
  var washNum2;
  // var moneysNum;
  var wpSub0;
  var wpSub1;
  var wpSub2;
  var wpSub3;
  var wpSub4;
  var wpSub5;
  var wpSub6;
  var wpSub7;
  var wpSub8;
  var ggSub0, ggSub1, ggSub2, ggSub3, ggSub4, ggSub5, ggSub6, ggSub7, ggSub8;
  $(".validateModalContent").on("click", ".submitNo", function () {
    $("#modal-overlay").hide();
    $(".validateLogo").hide();
  })
  $(".validateModalContent .validateListSubmit").click(function () {
    $("#modal-overlay").show();
    overlay();

    $(".validateLogo").html('<p class="validateLogoP">是否提交?</p><span class="submitYes">是</span><span class="submitNo">否</span>');
    $(".validatePerson").css('backgroundSize', 'contain');
    $(".validateModalContent .validateLogo").show();
    //    	setTimeout(function (){
    //    		window.location.reload();
    //    	},1000);
  });
  //删除此条记录
  $(".validateModalContent").on("click", ".validateListDelete", function () {

    $.ajax({
      url: '/updata/del?uuid=' + uuidValStr,
      type: 'get',
      success: function (data) {
        if (data.status == 200) {
          $("#modal-overlay").hide();
          $(".validateLogo").hide();
          backApproval();
        } else {
          $(".validateLogo").html('<p style="margin-top:1rem;">提交失败,请重试!</p>');
          $(".validatePerson").css('backgroundSize', 'contain');
          $(".validateModalContent .validateLogo").show();
          setTimeout(function () {
            $(".validateModalContent .validateLogo").hide();
            $("#modal-overlay").hide();
            $(".modal-overlay").css("visibility", "hidden");
          }, 1000);
        }

      },
      error: function (error) {
        $(".validateLogo").html('<p style="margin-top:1rem;">提交失败,请重试!</p>');
        $(".validatePerson").css('backgroundSize', 'contain');
        $(".validateModalContent .validateLogo").show();
        setTimeout(function () {
          $(".validateModalContent .validateLogo").hide();
          $("#modal-overlay").hide();
          $(".modal-overlay").css("visibility", "hidden");
        }, 1000);
        console.log(error);
      }
    });
  });
  $(".validateListNo").click(function () {
    $("#modal-overlay").show();
    overlay();
    $(".validateLogo").html('<p class="validateLogoP">是否删除此条记录?</p><span class="validateListDelete">是</span><span class="submitNo">否</span>');
    $(".validatePerson").css('backgroundSize', 'contain');
    $(".validateModalContent .validateLogo").show();
  });
  var infoNum1;

  //提交后，返回审核页面
  function backApproval() {
    approvalBtn = true;

    uuidImgVal1 = "";
    uuidImgVal2 = '';
    uuidImgVal3 = '';
    uuidImgVal4 = '';
    approvalBtn = true;
    $(".cameraImgBox img").attr("src", "");
    getImgBtnInterval1Str = false;
    getImgBtnInterval2Str = false;
    getImgBtnInterval3Str = false;
    getImgBtnInterval4Str = false;
    $(".cameraImgBoxStyle .cameraImgText").html('');
    window.clearInterval(getImgBtnInterval1);
    window.clearInterval(getImgBtnInterval2);
    window.clearInterval(getImgBtnInterval3);
    window.clearInterval(getImgBtnInterval4);
    window.clearTimeout(getImgBtnInterval5);


    //	隐藏模态框
    $(".cd-popup3").hide();
    $(".validateModalContent .validateLogo").hide();
    $("#modal-overlay").hide();
    $(".modal-overlay").css("visibility", "hidden");
    $(".approvalContent .approvedNoTable").html('<tr><th class="orderNum thBgc">序号</th><th class="approvalName thBgc">送物人姓名</th><th class="approvalTime thBgc">时间</th><th class="approvalPhone thBgc">联系电话</th><th class="approvalText thBgc">处理</th></tr>');


    //      重新获取数据
    $.ajax({
      url: "/provide/info",
      type: 'get',
      async: false,
      success: function (data) {
        if (data.status == "200") {
          infoNum1 = data.data.length;
          for (var i = 0; i < data.data.length; i++) {
            var swrxm = data.data[i].swrxm ? data.data[i].swrxm : "";
            var swrzjh = data.data[i].swrzjh ? data.data[i].swrzjh : "";
            var sjc = data.data[i].sjc ? data.data[i].sjc : "";
            var lxdh = data.data[i].lxdh ? data.data[i].lxdh : "";
            var uuid = data.data[i].uuid;
            sjc1 = timeToggle(sjc);
            // swrdz = data.data[i].swrdz;
            $(".approvalContent .approvedNoTable").append('<tr uuid=' + uuid + '><td class="orderNum">' + (+i + 1) + '</td><td class="approvalName">' + swrxm + '(' + swrzjh + ')</td><td class="approvalTime">' + sjc1 + '</td><td class="approvalPhone">' + lxdh + '</td><td class="approvalText"><span class="cd-popup-trigger3 approvalBtn">审批</span></td></tr>');
          }
        }

      },
      error: function (error) {
        console.log(error);
      }
    });
  }
  var submitFlag = true;
  $(".validateLogo").on("click", ".submitYes", function () {
    //	  判断物品有没有照片，有照片则可以提交
    var srcFlag = false;
    var src = '';
    for (var i = 0; i < 4; i++) {
      src = $('.cameraImgBox .cameraImgBoxStyle').eq(i).find('.cameraImgText img').attr('src');
      if (src) {
        srcFlag = true;
      }
      console.log(src)
    }
    if (srcFlag) {
      //    	测试：不校验物品拍照
      //  if (1==1) {
      if (submitFlag) {
        submitFlag = false;

        //照片提交
        $.ajax({
          url: "/insert/saveThing?uuid=" + uuidValStr + "&tpid=" + uuidImgVal1,
          type: 'get',
          async: false,
          success: function (data) {
            console.log(data);
          },
          error: function (error) {
            console.log(error);
          }
        });
        $.ajax({
          url: "/insert/saveThing?uuid=" + uuidValStr + "&tpid=" + uuidImgVal2,
          type: 'get',
          async: false,
          success: function (data) {
            console.log(data)

          },
          error: function (error) {
            console.log(error);
          }
        });
        $.ajax({
          url: "/insert/saveThing?uuid=" + uuidValStr + "&tpid=" + uuidImgVal3,
          type: 'get',
          async: false,
          success: function (data) {
            console.log(data)

          },
          error: function (error) {
            console.log(error);
          }
        });
        $.ajax({
          url: "/insert/saveThing?uuid=" + uuidValStr + "&tpid=" + uuidImgVal4,
          type: 'get',
          async: false,
          success: function (data) {
            console.log(data)

          },
          error: function (error) {
            console.log(error);
          }
        });
        //信息提交
        clothesNum = $(".validateGoods .goodsNumList").eq(0).find(".numGoods").text();
        pantsNum = $(".validateGoods .goodsNumList").eq(1).find(".numGoods").text();
        underwearNum = $(".validateGoods .goodsNumList").eq(2).find(".numGoods").text();
        socksNum = $(".validateGoods .goodsNumList").eq(3).find(".numGoods").text();
        cigaretteNum = $(".validateGoods .goodsNumList").eq(4).find(".numGoods").text();
        towelNum = $(".validateGoods .goodsNumList").eq(5).find(".numGoods").text();
        washNum = $(".validateGoods .goodsNumList").eq(6).find(".numGoods").text();
        washNum1 = $(".validateGoods .goodsNumList").eq(7).find(".numGoods").text();
        washNum2 = $(".validateGoods .goodsNumList").eq(8).find(".numGoods").text();

        wpSub0 = $(".validateGoods .goodsNumList").eq(0).find(".goodsText").text();
        wpSub1 = $(".validateGoods .goodsNumList").eq(1).find(".goodsText").text();
        wpSub2 = $(".validateGoods .goodsNumList").eq(2).find(".goodsText").text();
        wpSub3 = $(".validateGoods .goodsNumList").eq(3).find(".goodsText").text();
        wpSub4 = $(".validateGoods .goodsNumList").eq(4).find(".goodsText").text();
        wpSub5 = $(".validateGoods .goodsNumList").eq(5).find(".goodsText").text();
        wpSub6 = $(".validateGoods .goodsNumList").eq(6).find(".goodsText").text();
        wpSub7 = $(".validateGoods .goodsNumList").eq(7).find(".goodsText").text();
        wpSub8 = $(".validateGoods .goodsNumList").eq(8).find(".goodsText").text();

        ggSub0 = $(".validateGoods .goodsNumList").eq(0).find(".SpecificationsText").text();
        ggSub1 = $(".validateGoods .goodsNumList").eq(1).find(".SpecificationsText").text();
        ggSub2 = $(".validateGoods .goodsNumList").eq(2).find(".SpecificationsText").text();
        ggSub3 = $(".validateGoods .goodsNumList").eq(3).find(".SpecificationsText").text();
        ggSub4 = $(".validateGoods .goodsNumList").eq(4).find(".SpecificationsText").text();
        ggSub5 = $(".validateGoods .goodsNumList").eq(5).find(".SpecificationsText").text();
        ggSub6 = $(".validateGoods .goodsNumList").eq(6).find(".SpecificationsText").text();
        ggSub7 = $(".validateGoods .goodsNumList").eq(7).find(".SpecificationsText").text();
        ggSub8 = $(".validateGoods .goodsNumList").eq(8).find(".SpecificationsText").text();
        //------------------------------------
        if (clothesNum == "0" && pantsNum == "0" && underwearNum == "0" && socksNum == "0" && cigaretteNum == "0" && towelNum == "0" && washNum == "0" && washNum1 == "0" && washNum2) {
          $(".validateLogo").html('<img src="/public/img/validate/error.png" style="margin-top:0.30rem;" alt=""/><p>提交失败,请重试!</p>');
          $(".validatePerson").css('backgroundSize', 'contain');
          $(".validateModalContent .validateLogo").show();
          setTimeout(function () {
            $(".validateModalContent .validateLogo").hide();
            $("#modal-overlay").hide();
            $(".modal-overlay").css("visibility", "hidden");
          }, 1000);
        } else {

          var urlStr = '/updata/information?uuid=' + uuidValStr + '&wp=' + wpSub0 + ',' + wpSub1 + ',' + wpSub2 + ',' + wpSub3 + ',' + wpSub4 + ',' + wpSub5 + ',' + wpSub6 + ',' + wpSub7 + ',' + wpSub8 + '&sl=' + clothesNum + ',' + pantsNum + ',' + underwearNum + ',' + socksNum + ',' + cigaretteNum + ',' + towelNum + ',' + washNum + ',' + washNum1 + ',' + washNum2 + '&gg=' + ggSub0 + ',' + ggSub1 + ',' + ggSub2 + ',' + ggSub3 + ',' + ggSub4 + ',' + ggSub5 + ',' + ggSub6 + ',' + ggSub7 + ',' + ggSub8 + ',' + '&bz=ysp'; //+','+'&bz=ysp'
          console.log(urlStr)
          $.ajax({
            url: urlStr,
            type: 'get',
            async: false,
            success: function (result) {
              console.log(result);
              if (result.status == 200) {
                $(".validateLogo").html('<img src="/public/img/validate/correct.png" alt=""/><p>提交成功,是否打印?</p><span class="printYes">是</span><span class="no">否</span>');
                $(".validatePerson").css('backgroundSize', 'contain');
                $(".validateModalContent .validateLogo").show();
              } else {
                $(".validateLogo").html('<img src="/public/img/validate/error.png" style="margin-top:0.30rem;" alt=""/><p>提交失败,请重试!</p>');
                $(".validatePerson").css('backgroundSize', 'contain');
                $(".validateModalContent .validateLogo").show();
                setTimeout(function () {
                  $(".validateModalContent .validateLogo").hide();
                  $("#modal-overlay").hide();
                  $(".modal-overlay").css("visibility", "hidden");
                }, 1000);
              }
            },
            error: function (error) {
              console.log(error)
              $(".validateLogo").html('<img src="/public/img/validate/error.png" style="margin-top:0.30rem;" alt=""/><p>提交失败,请重试!</p>');
              $(".validatePerson").css('backgroundSize', 'contain');
              $(".validateModalContent .validateLogo").show();
              setTimeout(function () {
                $(".validateModalContent .validateLogo").hide();
                $("#modal-overlay").hide();
                $(".modal-overlay").css("visibility", "hidden");
              }, 1000);
            }
          });
        }
        setTimeout(function () {
          submitFlag = true;
        });
      }
    } else {
      $(".validateLogo").html('<img src="/public/img/validate/error.png" style="margin-top:0.30rem;" alt=""/><p>提交审核失败，缺少物品照片!</p>');
      $(".validatePerson").css('backgroundSize', 'contain');
      $(".validateModalContent .validateLogo").show();
      setTimeout(function () {
        $(".validateModalContent .validateLogo").hide();
        $("#modal-overlay").hide();
        $(".modal-overlay").css("visibility", "hidden");
      }, 1000);
    }
  });
  //是否打印
  var printFlag = true;
  $(".validateLogo").on("click", ".printYes", function () {
    if (printFlag) {
      printFlag = false;
      $("#printing table .trGoods").html('<td colspan="2">物品</td><td>数量</td><td>规格</td><td>特征</td><td colspan="3">备注</td>');
      $("#printing1 table .trGoods").html('<td colspan="2">物品</td><td>数量</td><td>规格</td><td>特征</td><td colspan="3">备注</td>');
      $(".goodsNumListBox .goodsNumList").each(function (i, item) {
        var goodsTexti = $(".goodsNumListBox .goodsNumList").eq(i).find(".goodsText").text();
        var numGoodsi = $(".goodsNumListBox .goodsNumList").eq(i).find(".numGoods").text();
        var SpecificationsText = $(".goodsNumListBox .goodsNumList").eq(i).find(".SpecificationsText").text();
        if (numGoodsi != "0") {
          $("#printing table .trGoods").append('<tr><td colspan="2">' + goodsTexti + '</td><td>' + numGoodsi + '</td><td>' + SpecificationsText + '</td><td></td><td colspan="3"></td></tr>');
          $("#printing1 table .trGoods").append('<tr><td colspan="2">' + goodsTexti + '</td><td>' + numGoodsi + '</td><td>' + SpecificationsText + '</td><td></td><td colspan="3"></td></tr>');
        }

      });
      var printLen = $("#printing tr").length;
      printLen = 15 - printLen;
      for (var i = 0; i < printLen; i++) {
        $("#printing table .trGoods").append('<tr><td colspan="2"></td><td></td><td></td><td></td><td colspan="3"></td></tr>');
        $("#printing1 table .trGoods").append('<tr><td colspan="2"></td><td></td><td></td><td></td><td colspan="3"></td></tr>');

      }
      $("#printingBox").jqprint();
      setTimeout(function () {
        backApproval();
        printFlag = true;
        //        	window.location.reload();
      }, 1000);
    }
  });
  $(".validateLogo").on("click", ".no", function () {
    //    	window.location.reload();
    backApproval();
  });
  //登录后获取审批信息
  //每隔十秒钟刷新
  var approvalBtn = true;
  // var swrdz;
  setInterval(function () {
    if (approvalBtn) {
      ///history/approve?page=1
      $.ajax({
        url: "/provide/info",
        type: 'get',
        success: function (data) {
          if (infoNum1 != data.data.length) {
            infoNum1 = data.data.length;
            $(".approvalContent .approvedNoTable").html('<tr><th class="orderNum thBgc">序号</th><th class="approvalName thBgc">送物人姓名</th><th class="approvalTime thBgc">时间</th><th class="approvalPhone thBgc">联系电话</th><th class="approvalText thBgc">处理</th></tr>');

            for (var i = 0; i < data.data.length; i++) {
              var swrxm = data.data[i].swrxm ? data.data[i].swrxm : "";
              var swrzjh = data.data[i].swrzjh ? data.data[i].swrzjh : "";
              var sjc = data.data[i].sjc ? data.data[i].sjc : "";
              var lxdh = data.data[i].lxdh ? data.data[i].lxdh : "";
              var uuid = data.data[i].uuid;
              sjc1 = timeToggle(sjc);
              // swrdz = data.data[i].swrdz;
              $(".approvalContent .approvedNoTable").append('<tr uuid=' + uuid + '><td class="orderNum">' + (+i + 1) + '</td><td class="approvalName">' + swrxm + '(' + swrzjh + ')</td><td class="approvalTime">' + sjc1 + '</td><td class="approvalPhone">' + lxdh + '</td><td class="approvalText"><span class="cd-popup-trigger3 approvalBtn">审批</span></td></tr>');
            }
          }

        },
        error: function (error) {
          console.log(error);
        }
      });

    }
  }, 5000);
  $.ajax({
    url: "/provide/info",
    type: 'get',
    success: function (data) {
      console.log(data)
      if (data.status == "200") {
        infoNum1 = data.data.length;
        for (var i = 0; i < data.data.length; i++) {
          var swrxm = data.data[i].swrxm ? data.data[i].swrxm : "";
          var swrzjh = data.data[i].swrzjh ? data.data[i].swrzjh : "";
          var sjc = data.data[i].sjc ? data.data[i].sjc : "";
          var lxdh = data.data[i].lxdh ? data.data[i].lxdh : "";
          var uuid = data.data[i].uuid;
          // swrdz = data.data[i].swrdz;
          sjc1 = timeToggle(sjc);
          $(".approvalContent .approvedNoTable").append('<tr uuid=' + uuid + '><td class="orderNum">' + (+i + 1) + '</td><td class="approvalName">' + swrxm + '(' + swrzjh + ')</td><td class="approvalTime">' + sjc1 + '</td><td class="approvalPhone">' + lxdh + '</td><td class="approvalText"><span class="cd-popup-trigger3 approvalBtn">审批</span></td></tr>');
        }
      } else {
        $(".validateLogo").html('<img src="/public/img/validate/error.png" style="margin-top:0.30rem;" alt=""/><p>请求错误,请重试!</p>');
        $(".validatePerson").css('backgroundSize', 'contain');
        $(".validateModalContent .validateLogo").show();
        setTimeout(function () {
          $(".validateModalContent .validateLogo").hide();
          $("#modal-overlay").hide();
          $(".modal-overlay").css("visibility", "hidden");
        }, 1000);
      }

    },
    error: function (error) {
      $(".validateLogo").html('<img src="/public/img/validate/error.png" style="margin-top:0.30rem;" alt=""/><p>请求错误,请重试!</p>');
      $(".validatePerson").css('backgroundSize', 'contain');
      $(".validateModalContent .validateLogo").show();
      setTimeout(function () {
        $(".validateModalContent .validateLogo").hide();
        $("#modal-overlay").hide();
        $(".modal-overlay").css("visibility", "hidden");
      }, 1000);
    }
  });

  //审核按钮
  var uuidValStr;

  var swrzjhSub;
  var swrxmSub;
  var djbhSub;
  var nameSub;
  var zjhmSub;
  var yzyrygxSub;
  var lxdhSub;
  var rsshSub;
  var jshSub;
  var sjcSub;

  function overlay() {
    var e1 = document.getElementById('modal-overlay');
    e1.style.visibility = "visible"; //(e1.style.visibility == "visible") ? "hidden" : 
  }
  $(".approvalContent").on("click", ".approvalBtn", function () {
    approvalBtn = false;
    $(".validateGoods").find(".numGoods").css("backgroundColor", "#fff");
    $(".validateGoods").find(".numGoods").css("color", "#000");
    $(".validateGoods").find(".addGoods").css("backgroundColor", "#fff");
    $(".validateGoods").find(".reduceGoods").css("backgroundColor", "#fff");

    uuidValStr = $(this).parent().parent().attr("uuid");
    $(".listRight li").eq(0).find("img").removeAttr("src");
    $(".listRight li").eq(1).find("img").removeAttr("src");
    $(".listRight .cameraImgBox").find("img").hide();
    $(".cameraImgBoxStyle").css("background", "url(/public/img/photograph.png) no-repeat center 0.53rem");
    $(".cameraImgBoxStyle").css("background-color", "#108cbe");
    $(".cameraImgBoxStyle").css("background-size", "1rem");
    // $(".listLeft").find(".list5 span").text(swrdz);
    console.log(uuidValStr)
    $(".goodsNumListBox").html("");
    //渲染物品
    $.ajax({
      url: "/provide/list?uuid=" + uuidValStr,
      type: 'get',
      async: false,
      success: function (data) {
        if (data.status == 200) {
          for (var i = 0; i < data.data.length; i++) {
            var goodsSl = data.data[i].sl ? data.data[i].sl : "0";
            var goodsWp = data.data[i].wp;
            var goodsgg = data.data[i].gg;
            $(".cd-popup3").show();
            $(".goodsNumListBox").append('<div class="goodsNumList"><span class="goodsText">' + goodsWp + '</span><span class="reduceGoods">-</span><span class="numGoods">' + goodsSl + '</span><span class="addGoods">+</span><span class="SpecificationsText">' + goodsgg + '</span></div>');
            $(".validateGoods .goodsNumList").eq(i).find(".numGoods").text(goodsSl);
            $(".validateGoods .goodsNumList").eq(i).find(".goodsText").text(goodsWp);
            //打印
            var Specifications = data.data[i].gg ? data.data[i].gg : "";
          }
        }

      },
      error: function (error) {
        $(".validateLogo").html('<img src="/public/img/validate/error.png" style="margin-top:0.30rem;" alt=""/><p>请求错误,请重试!</p>');
        $(".validatePerson").css('backgroundSize', 'contain');
        $(".validateModalContent .validateLogo").show();
        setTimeout(function () {
          $(".validateModalContent .validateLogo").hide();
          $("#modal-overlay").hide();
          $(".modal-overlay").css("visibility", "hidden");
        }, 1000);
      }
    });
    //送物人信息
    var fxryshzStr;

    $.ajax({
      url: "/provide/backinfo?uuid=" + uuidValStr,
      type: 'get',
      async: false,
      success: function (data) {
        console.log(data)
        swrzjhSub = data.data.swrzjh;
        swrxmSub = data.data.swrxm;
        djbhSub = data.data.djbh;
        nameSub = data.data.name;
        zjhmSub = data.data.zjhm;
        yzyrygxSub = data.data.yzyrygx;
        lxdhSub = data.data.lxdh;
        rsshSub = data.data.rssj;
        sjcSub = data.data.sjc;
        jshSub = data.data.jsh;
        $(".listLeft tbody tr").eq(0).find(".list1 span").text(data.data.swrxm + '(' + data.data.swrzjh + ')');
        $(".listLeft tbody tr").eq(2).find(".list1 span").text(data.data.djbh);
        $(".listLeft tbody tr").eq(2).find(".list2 span").text(timeToggle(sjcSub));
        $(".listLeft tbody tr").eq(1).find(".list1 span").text(nameSub + "(" + data.data.zjhm + ")");
        $(".listLeft tbody tr").eq(0).find(".list3 span").text(data.data.yzyrygx);
        $(".listLeft tbody tr").eq(0).find(".list2 span").text(data.data.lxdh);
        $(".listLeft tbody tr").eq(1).find(".list2 span").text(timeToggle(rsshSub));
        $(".listLeft tbody tr").eq(2).find(".list3 span").text(username);

        $("#printing p span").text(djbhSub);
        $("#printing tr").eq(0).find("td").eq(1).text(nameSub);
        $("#printing tr").eq(0).find("td").eq(3).text(timeToggle(rsshSub));
        $("#printing tr").eq(0).find("td").eq(5).text(jshSub);
        $("#printing tr").eq(1).find("td").eq(1).text(username);
        $("#printing tr").eq(1).find("td").eq(3).text(timeToggle(sjcSub));
        $("#printing tr").eq(2).find("td").eq(1).text(swrxmSub);
        $("#printing tr").eq(2).find("td").eq(5).text(swrzjhSub);

        $("#printing1 p span").text(djbhSub);
        $("#printing1 tr").eq(0).find("td").eq(1).text(nameSub);
        $("#printing1 tr").eq(0).find("td").eq(3).text(timeToggle(rsshSub));
        $("#printing1 tr").eq(0).find("td").eq(5).text(jshSub);
        $("#printing1 tr").eq(1).find("td").eq(1).text(username);
        $("#printing1 tr").eq(1).find("td").eq(3).text(timeToggle(sjcSub));
        $("#printing1 tr").eq(2).find("td").eq(1).text(swrxmSub);
        $("#printing1 tr").eq(2).find("td").eq(5).text(swrzjhSub);

        var swrdz = data.data.swrdz;
        $(".listLeft").find(".list5 span").text(swrdz);
        fxryshzStr = data.data.zjhm;
      },
      error: function (error) {
        $(".validateLogo").html('<img src="/public/img/validate/error.png" style="margin-top:0.30rem;" alt=""/><p>请求错误,请重试!</p>');
        $(".validatePerson").css('backgroundSize', 'contain');
        $(".validateModalContent .validateLogo").show();
        setTimeout(function () {
          $(".validateModalContent .validateLogo").hide();
          $("#modal-overlay").hide();
          $(".modal-overlay").css("visibility", "hidden");
        }, 1000);
      }
    });
    // TODO
    //在押人员
    $.ajax({
      url: "/provide/getPrisonerInfo?zjhm=" + fxryshzStr,
      type: 'get',
      async: false,
      success: function (data) {
        console.log(data)
        if (data.status == 200) {
          jshSub = data.data.jsh;
          var rsshSub = data.data.rssh;
          $(".listLeft tbody tr").eq(1).find(".list3 span").text(data.data.jsh);
        } else {
          $(".validateLogo").html('<img src="/public/img/validate/error.png" style="margin-top:0.30rem;" alt=""/><p>' + data.message + '</p>');
          $(".validatePerson").css('backgroundSize', 'contain');
          $(".validateModalContent .validateLogo").show();
          setTimeout(function () {
            $(".validateModalContent .validateLogo").hide();
            $("#modal-overlay").hide();
            $(".modal-overlay").css("visibility", "hidden");
          }, 1000);
        }

      },
      error: function (error) {
        $(".validateLogo").html('<img src="/public/img/validate/error.png" style="margin-top:0.30rem;" alt=""/><p>请求错误,请重试!</p>');
        $(".validatePerson").css('backgroundSize', 'contain');
        $(".validateModalContent .validateLogo").show();
        setTimeout(function () {
          $(".validateModalContent .validateLogo").hide();
          $("#modal-overlay").hide();
          $(".modal-overlay").css("visibility", "hidden");
        }, 1000);
      }
    });


    $.ajax({
      url: "/ic/getImg?uuid=" + uuidValStr,
      type: 'get',
      async: false,
      success: function (data) {
        $(".listRight li").eq(1).find("img").show()
        $(".listRight li").eq(1).find("img").attr("src", "/ic/getImg?uuid=" + uuidValStr);
      },
      error: function (error) {
        $(".listRight li").eq(1).find("img").hide();
      }
    });
    //人脸比对结果
    $.ajax({
      url: "/verify/data?uuid=" + uuidValStr,
      type: 'get',
      success: function (data) {
        if (data.status == 200) {

          if (data.data.result == '1') {
            $(".listRight li").eq(0).find('img').show();
            $(".validatePerson").css('background', 'url(/public/img/validate/identitySuccess-red.png) no-repeat');
            $(".validatePerson").css('backgroundSize', 'contain');
            $(".listRight li").eq(0).find("img").attr("src", "/verify/getImg?uuid=" + uuidValStr);
          } else if (data.data.result == '2' || data.data.result == '3') {
            $(".listRight li").eq(0).find('img').show();
            $(".listRight li").eq(0).find("img").attr("src", "/verify/getImg?uuid=" + uuidValStr);
            $(".validatePerson").css('background', 'url(/public/img/validate/identityFail.png) no-repeat');
            $(".validatePerson").css('backgroundSize', 'contain')
          } else {
            $(".listRight li").eq(0).find('img').hide();
            $(".validatePerson").css('background', 'url(/public/img/validate/identityFail.png) no-repeat');
            $(".validatePerson").css('backgroundSize', 'contain')
          }
        } else {
          //		    	  $(".listRight li").eq(0).find("span").text("照片")
          $(".listRight li").eq(0).find('img').hide();
          $(".validatePerson").css('background', 'url(/public/img/validate/identityFail.png) no-repeat');
          $(".validatePerson").css('backgroundSize', 'contain')
        }


      },
      error: function (error) {
        $(".listRight li").eq(0).find('img').hide();
        console.log(error);
      }
    });
    setTimeout(function () {
      getImgBtnInterval1Str = true;
      getImgBtnInterval2Str = true;
      getImgBtnInterval3Str = true;
      getImgBtnInterval4Str = true;
      timeoutflag = false;
    }, 0);
    //	startImgBtnInterval = setInterval(function (){
    startBtnTimeNum = (new Date()).valueOf();
    $(".listRight .cameraImgBtn").attr("href", "f1://" + startBtnTimeNum);

    //	},1);
  });
  //图片拍照

  var startBtnTimeNum, startImgBtnInterval, startImgBtnInterval1, startImgBtnInterval2, startImgBtnInterval3, startImgBtnInterval4;
  var uuidImgVal1, uuidImgVal2, uuidImgVal3, uuidImgVal4;
  var clickFrequency = 1;

  var timeoutflag = false;
  var getImgBtnInterval1, getImgBtnInterval2, getImgBtnInterval3, getImgBtnInterval4, getImgBtnInterval1Str, getImgBtnInterval2Str, getImgBtnInterval3Str, getImgBtnInterval4Str, getImgBtnInterval5;

  var cameraImg = document.getElementById("cameraImg");
  cameraImg.addEventListener('touchstart', function () {
    console.log(99)
    //	$(".cameraImg").click(function (){
    if (!timeoutflag) {
      timeoutflag = true;
      setTimeout(function () {

        //判断路径是否存在
        if (!$(".cameraImgBox1 img").attr("src")) {
          clickFrequency = 1;
        } else if ($(".cameraImgBox1 img").attr("src")) {
          if (!$(".cameraImgBox2 img").attr("src")) {
            clickFrequency = 2;
          } else if ($(".cameraImgBox2 img").attr("src")) {
            if (!$(".cameraImgBox3 img").attr("src")) {
              clickFrequency = 3;
            } else if ($(".cameraImgBox3 img").attr("src")) {
              if (!$(".cameraImgBox4 img").attr("src")) {
                clickFrequency = 4;
              } else if ($(".cameraImgBox4 img").attr("src")) {
                clickFrequency = "";
              }
            }
          }
        }
        //   	   	window.clearInterval(startImgBtnInterval);
        if (clickFrequency < 5) {
          if (clickFrequency == 1) {
            uuidImgVal1 = $(".listRight .cameraImgBtn").attr("href");
            uuidImgVal1 = uuidImgVal1.substr(5, uuidImgVal1.length - 1);
            window.location.href = "f1://" + uuidImgVal1;
            var imgUrl = '/picture/getImg?uuid=';
            imgUrl = imgUrl + uuidImgVal1;

            $(".cameraImgBox1 .cameraImgText").html('<span style="margin-top:0.35rem;display: block;">拍摄中</span>');
            $(".cameraImgBox1").css("background", "#108cbe");

            //每隔一秒钟取照片
            getImgBtnInterval1Str = true;
            clearInterval(getImgBtnInterval1);
            getImgBtnInterval1 = setInterval(function () {
              console.log(9)
              if (getImgBtnInterval1Str) {
                $.ajax({
                  url: imgUrl,
                  type: 'get',
                  async: false,
                  success: function (data) {
                    getImgBtnInterval1Str = false;
                    window.clearInterval(getImgBtnInterval1);
                    $(".listRight .cameraImgBox").find("img").show();
                    $(".cameraImgBox1 .cameraImgText").html('<img src="' + imgUrl + '" />');
                    clickFrequency = 2;
                    timeoutflag = false;
                    startBtnTimeNum = (new Date()).valueOf();
                    $(".listRight .cameraImgBtn").attr("href", "f1://" + startBtnTimeNum);
                  }
                });
              }

            }, 1000);
            //五秒钟后取照片，没有取到则提醒
            getImgBtnInterval5 = setTimeout(function () {
              if (getImgBtnInterval1Str) {
                getImgBtnInterval1Str = false;
                window.clearInterval(getImgBtnInterval1);
                $.ajax({
                  url: imgUrl,
                  type: 'get',
                  async: false,
                  success: function (data) {
                    timeoutflag = false;
                    //   		   	   	      	    $(".listRight .cameraImgBox").find("img").show();
                    //   		   	   	      	    $(".cameraImgBox1 .cameraImgText").html('<img src="'+imgUrl+'" />');
                    clickFrequency = 2;
                    //		   		   			startBtnTimeNum = (new Date()).valueOf();
                    //		   		   			$(".listRight .cameraImgBtn").attr("href","f1://"+startBtnTimeNum);
                  },
                  error: function (error) {
                    $(".cameraImgBox1").css("background", "#108cbe");
                    $(".cameraImgBox1 .cameraImgText").html('<span style="margin-top:0.35rem;display: block;">拍摄失败</span>');

                    setTimeout(function () {
                      timeoutflag = false;
                      $(".cameraImgBox1 .cameraImgText").html('<img src="" />');

                      $(".cameraImgBox1").css("background", "url(/public/img/photograph.png) no-repeat center 0.53rem");
                      $(".cameraImgBox1").css("background-color", "#108cbe");
                      $(".cameraImgBox1").css("background-size", "1rem");
                    }, 1000);
                    console.log(error);
                    clickFrequency = 1;
                    startBtnTimeNum = (new Date()).valueOf();
                    $(".listRight .cameraImgBtn").attr("href", "f1://" + startBtnTimeNum);
                  }
                });
              }

            }, 10000);
            //   	   	    	startImgBtnInterval1 = setInterval(function (){
            //   	   	    	},1);
          } else if (clickFrequency == 2) {
            uuidImgVal2 = $(".listRight .cameraImgBtn").attr("href");
            uuidImgVal2 = uuidImgVal2.substr(5, uuidImgVal2.length - 1);
            window.location.href = "f1://" + uuidImgVal2;
            var imgUrl = '/picture/getImg?uuid=';
            imgUrl = imgUrl + uuidImgVal2;
            $(".cameraImgBox2 .cameraImgText").html('<span style="margin-top:0.35rem;display: block;">拍摄中</span>');
            $(".cameraImgBox2").css("background", "#108cbe");
            //每隔一秒钟取照片
            clearInterval(getImgBtnInterval2);
            getImgBtnInterval2Str = true;
            getImgBtnInterval2 = setInterval(function () {
              console.log(9)
              if (getImgBtnInterval2Str) {
                $.ajax({
                  url: imgUrl,
                  type: 'get',
                  async: false,
                  success: function (data) {
                    getImgBtnInterval2Str = false;
                    window.clearInterval(getImgBtnInterval2);
                    $(".listRight .cameraImgBox").find("img").show();
                    $(".cameraImgBox2 .cameraImgText").html('<img src="' + imgUrl + '" />');
                    clickFrequency = 3;
                    timeoutflag = false;
                    startBtnTimeNum = (new Date()).valueOf();
                    $(".listRight .cameraImgBtn").attr("href", "f1://" + startBtnTimeNum);
                  }
                });
              }

            }, 1000);
            getImgBtnInterval5 = setTimeout(function () {
              if (getImgBtnInterval2Str) {
                getImgBtnInterval2Str = false;

                window.clearInterval(getImgBtnInterval2);
                $.ajax({
                  url: imgUrl,
                  type: 'get',
                  async: false,
                  success: function (data) {
                    timeoutflag = false;
                    //			   	   	      	    $(".listRight .cameraImgBox").find("img").show();
                    //			   	   	      	    $(".cameraImgBox2 .cameraImgText").html('<img src="'+imgUrl+'" />');
                    clickFrequency = 3;
                    //			   		   			startBtnTimeNum = (new Date()).valueOf();
                    //			   		   			$(".listRight .cameraImgBtn").attr("href","f1://"+startBtnTimeNum);
                  },
                  error: function (error) {
                    console.log(error);
                    $(".cameraImgBox2").css("background", "#108cbe");
                    $(".cameraImgBox2 .cameraImgText").html('<span style="margin-top:0.35rem;display: block;">拍摄失败</span>');
                    setTimeout(function () {
                      timeoutflag = false;
                      $(".cameraImgBox2 .cameraImgText").html('<img src="" />');

                      $(".cameraImgBox2").css("background", "url(/public/img/photograph.png) no-repeat center 0.53rem");
                      $(".cameraImgBox2").css("background-color", "#108cbe");
                      $(".cameraImgBox2").css("background-size", "1rem");
                    }, 1000);
                    clickFrequency = 2;
                    startBtnTimeNum = (new Date()).valueOf();
                    $(".listRight .cameraImgBtn").attr("href", "f1://" + startBtnTimeNum);
                  }
                });
              }
            }, 10000);
            //   	   	    	startImgBtnInterval2 = setInterval(function (){
            //   	   	    	},1);
          } else if (clickFrequency == 3) {
            uuidImgVal3 = $(".listRight .cameraImgBtn").attr("href");
            uuidImgVal3 = uuidImgVal3.substr(5, uuidImgVal3.length - 1);
            window.location.href = "f1://" + uuidImgVal3;
            var imgUrl = '/picture/getImg?uuid=';
            imgUrl = imgUrl + uuidImgVal3;
            $(".cameraImgBox3 .cameraImgText").html('<span style="margin-top:0.35rem;display: block;">拍摄中</span>');
            $(".cameraImgBox3").css("background", "#108cbe");
            //每隔一秒钟取照片
            clearInterval(getImgBtnInterval3);
            getImgBtnInterval3Str = true;
            getImgBtnInterval3 = setInterval(function () {
              if (getImgBtnInterval3) {
                $.ajax({
                  url: imgUrl,
                  type: 'get',
                  async: false,
                  success: function (data) {
                    getImgBtnInterval3Str = false;
                    window.clearInterval(getImgBtnInterval3);
                    timeoutflag = false;
                    $(".listRight .cameraImgBox").find("img").show();
                    $(".cameraImgBox3 .cameraImgText").html('<img src="' + imgUrl + '" />');
                    clickFrequency = 4;
                    startBtnTimeNum = (new Date()).valueOf();
                    $(".listRight .cameraImgBtn").attr("href", "f1://" + startBtnTimeNum);
                  }
                });
              }

            }, 1000);
            getImgBtnInterval5 = setTimeout(function () {
              if (getImgBtnInterval3Str) {
                window.clearInterval(getImgBtnInterval3);
                getImgBtnInterval3Str = false;
                $.ajax({
                  url: imgUrl,
                  type: 'get',
                  async: false,
                  success: function (data) {
                    timeoutflag = false;
                    //			   	   	      	    $(".listRight .cameraImgBox").find("img").show();
                    //			   	   	      	    $(".cameraImgBox3 .cameraImgText").html('<img src="'+imgUrl+'" />');
                    clickFrequency = 4;
                    //			   		   			startBtnTimeNum = (new Date()).valueOf();
                    //			   		   			$(".listRight .cameraImgBtn").attr("href","f1://"+startBtnTimeNum);
                  },
                  error: function (error) {
                    $(".cameraImgBox3").css("background", "#108cbe");
                    $(".cameraImgBox3 .cameraImgText").html('<span style="margin-top:0.35rem;display: block;">拍摄失败</span>');
                    setTimeout(function () {
                      timeoutflag = false;
                      $(".cameraImgBox3 .cameraImgText").html('<img src="" />');

                      $(".cameraImgBox3").css("background", "url(/public/img/photograph.png) no-repeat center 0.53rem");
                      $(".cameraImgBox3").css("background-color", "#108cbe");
                      $(".cameraImgBox3").css("background-size", "1rem");
                    }, 1000);
                    console.log(error);
                    clickFrequency = 3;
                    startBtnTimeNum = (new Date()).valueOf();
                    $(".listRight .cameraImgBtn").attr("href", "f1://" + startBtnTimeNum);
                  }
                });
              }
            }, 10000);
            //   	   	    	startImgBtnInterval3 = setInterval(function (){
            //   	   	    	},1);
          } else if (clickFrequency == 4) {
            uuidImgVal4 = $(".listRight .cameraImgBtn").attr("href");
            uuidImgVal4 = uuidImgVal4.substr(5, uuidImgVal4.length - 1);
            window.location.href = "f1://" + uuidImgVal4;
            var imgUrl = '/picture/getImg?uuid=';
            imgUrl = imgUrl + uuidImgVal4;
            $(".cameraImgBox4 .cameraImgText").html('<span style="margin-top:0.35rem;display: block;">拍摄中</span>');
            $(".cameraImgBox4").css("background", "#108cbe");
            //每隔一秒钟取照片
            clearInterval(getImgBtnInterval4);
            getImgBtnInterval4Str = true;
            getImgBtnInterval4 = setInterval(function () {
              if (getImgBtnInterval4Str) {
                $.ajax({
                  url: imgUrl,
                  type: 'get',
                  async: false,
                  success: function (data) {
                    window.clearInterval(getImgBtnInterval4);
                    getImgBtnInterval4Str = false;
                    $(".listRight .cameraImgBox").find("img").show();
                    $(".cameraImgBox4 .cameraImgText").html('<img src="' + imgUrl + '" />');
                    clickFrequency = "";
                    timeoutflag = false;
                    startBtnTimeNum = (new Date()).valueOf();
                    $(".listRight .cameraImgBtn").attr("href", "f1://" + startBtnTimeNum);
                  }
                });
              }

            }, 1000);
            getImgBtnInterval5 = setTimeout(function () {
              if (getImgBtnInterval4Str) {
                window.clearInterval(getImgBtnInterval4);
                getImgBtnInterval4Str = false;
                $.ajax({
                  url: imgUrl,
                  type: 'get',
                  async: false,
                  success: function (data) {
                    timeoutflag = false;
                    //			   	   	      	    $(".listRight .cameraImgBox").find("img").show();
                    //			   	   	      	    $(".cameraImgBox4 .cameraImgText").html('<img src="'+imgUrl+'" />');
                    clickFrequency = "";
                    //			   		   			startBtnTimeNum = (new Date()).valueOf();
                    //			   		   			$(".listRight .cameraImgBtn").attr("href","f1://"+startBtnTimeNum);
                  },
                  error: function (error) {
                    $(".cameraImgBox4").css("background", "#108cbe");
                    $(".cameraImgBox4 .cameraImgText").html('<span style="margin-top:0.35rem;display: block;">拍摄失败</span>');
                    setTimeout(function () {
                      timeoutflag = false;
                      $(".cameraImgBox4 .cameraImgText").html('<img src="" />');

                      $(".cameraImgBox4").css("background", "url(/public/img/photograph.png) no-repeat center 0.53rem");
                      $(".cameraImgBox4").css("background-color", "#108cbe");
                      $(".cameraImgBox4").css("background-size", "1rem");
                    }, 1000);
                    console.log(error);
                    clickFrequency = 4;
                    startBtnTimeNum = (new Date()).valueOf();
                    $(".listRight .cameraImgBtn").attr("href", "f1://" + startBtnTimeNum);
                  }
                });
              }
            }, 10000);
            //   	   	    	startImgBtnInterval4 = setInterval(function (){
            //   	   	    	},1);
          }
        }
      }, 0);
    }
    //   		setTimeout(function (){
    //   			timeoutflag = false;
    //   		},3000);
  });
  //删除照片
  $(".cameraImgBox1 .cameraImgHeader-close").click(function () {
    $('.cameraImgBox1 img').attr("src", "");
    $(".cameraImgBox1").css("background", "url(/public/img/photograph.png) no-repeat center 0.53rem");
    $(".cameraImgBox1").css("background-color", "#108cbe");
    $(".cameraImgBox1").css("background-size", "1rem");
    $(".cameraImgBox1 .cameraImgText").html('');
    clearInterval(getImgBtnInterval1);
    clearInterval(getImgBtnInterval2);
    clearInterval(getImgBtnInterval3);
    clearInterval(getImgBtnInterval4);
    if (!$(".cameraImgBox1 img").attr("src")) {
      clickFrequency = 1;
    } else if ($(".cameraImgBox1 img").attr("src")) {
      if (!$(".cameraImgBox2 img").attr("src")) {
        clickFrequency = 2;
      } else if ($(".cameraImgBox2 img").attr("src")) {
        if (!$(".cameraImgBox3 img").attr("src")) {
          clickFrequency = 3;
        } else if ($(".cameraImgBox3 img").attr("src")) {
          if (!$(".cameraImgBox4 img").attr("src")) {
            clickFrequency = 4;
          } else if ($(".cameraImgBox4 img").attr("src")) {
            clickFrequency = 5;
          }
        }
      }
    }
    timeoutflag = false;
  });
  $(".cameraImgBox2 .cameraImgHeader-close").click(function () {
    $('.cameraImgBox2 img').attr("src", "");
    $(".cameraImgBox2").css("background", "url(/public/img/photograph.png) no-repeat center 0.53rem");
    $(".cameraImgBox2").css("background-color", "#108cbe");
    $(".cameraImgBox2").css("background-size", "1rem");
    $(".cameraImgBox2 .cameraImgText").html('');
    clearInterval(getImgBtnInterval1);
    clearInterval(getImgBtnInterval2);
    clearInterval(getImgBtnInterval3);
    clearInterval(getImgBtnInterval4);
    if (!$(".cameraImgBox1 img").attr("src")) {
      clickFrequency = 1;
    } else if ($(".cameraImgBox1 img").attr("src")) {
      if (!$(".cameraImgBox2 img").attr("src")) {
        clickFrequency = 2;
      } else if ($(".cameraImgBox2 img").attr("src")) {
        if (!$(".cameraImgBox3 img").attr("src")) {
          clickFrequency = 3;
        } else if ($(".cameraImgBox3 img").attr("src")) {
          if (!$(".cameraImgBox4 img").attr("src")) {
            clickFrequency = 4;
          } else if ($(".cameraImgBox4 img").attr("src")) {
            clickFrequency = "";
          }
        }
      }
    }
    timeoutflag = false;
    //   		clickFrequency = 2;
  });
  $(".cameraImgBox3 .cameraImgHeader-close").click(function () {
    $('.cameraImgBox3 img').attr("src", "");
    $(".cameraImgBox3").css("background", "url(/public/img/photograph.png) no-repeat center 0.53rem");
    $(".cameraImgBox3").css("background-color", "#108cbe");
    $(".cameraImgBox3").css("background-size", "1rem");
    $(".cameraImgBox3 .cameraImgText").html('');
    clearInterval(getImgBtnInterval1);
    clearInterval(getImgBtnInterval2);
    clearInterval(getImgBtnInterval3);
    clearInterval(getImgBtnInterval4);
    if (!$(".cameraImgBox1 img").attr("src")) {
      clickFrequency = 1;
    } else if ($(".cameraImgBox1 img").attr("src")) {
      if (!$(".cameraImgBox2 img").attr("src")) {
        clickFrequency = 2;
      } else if ($(".cameraImgBox2 img").attr("src")) {
        if (!$(".cameraImgBox3 img").attr("src")) {
          clickFrequency = 3;
        } else if ($(".cameraImgBox3 img").attr("src")) {
          if (!$(".cameraImgBox4 img").attr("src")) {
            clickFrequency = 4;
          } else if ($(".cameraImgBox4 img").attr("src")) {
            clickFrequency = 5;
          }
        }
      }
    }
    timeoutflag = false;
    //   		clickFrequency = 3;
  });
  $(".cameraImgBox4 .cameraImgHeader-close").click(function () {
    $('.cameraImgBox4 img').attr("src", "");
    $(".cameraImgBox4").css("background", "url(/public/img/photograph.png) no-repeat center 0.53rem");
    $(".cameraImgBox4").css("background-color", "#108cbe");
    $(".cameraImgBox4").css("background-size", "1rem");
    $(".cameraImgBox4 .cameraImgText").html('');
    clearInterval(getImgBtnInterval1);
    clearInterval(getImgBtnInterval2);
    clearInterval(getImgBtnInterval3);
    clearInterval(getImgBtnInterval4);
    if (!$(".cameraImgBox1 img").attr("src")) {
      clickFrequency = 1;
    } else if ($(".cameraImgBox1 img").attr("src")) {
      if (!$(".cameraImgBox2 img").attr("src")) {
        clickFrequency = 2;
      } else if ($(".cameraImgBox2 img").attr("src")) {
        if (!$(".cameraImgBox3 img").attr("src")) {
          clickFrequency = 3;
        } else if ($(".cameraImgBox3 img").attr("src")) {
          if (!$(".cameraImgBox4 img").attr("src")) {
            clickFrequency = 4;
          } else if ($(".cameraImgBox4 img").attr("src")) {
            clickFrequency = 5;
          }
        }
      }
    }
    timeoutflag = false;
    //   		clickFrequency = 4;
  });
  //添加物品
  var goodsNum, goodsIndex, moneyIndex;
  var moneyNum = 0;
  $(".validateGoods").on("click", ".addGoods", function () {
    if (disableFlag) {
      goodsNum = +$(this).siblings(".numGoods").text();
      goodsIndex = $(this).parent().parent().index();
      goodsNum += 1;
      $(this).siblings(".numGoods").text(goodsNum);
    }

  });
  //减少物品按钮
  $(".validateGoods").on("click", ".reduceGoods", function () {
    if (disableFlag) {
      goodsNum = +$(this).siblings(".numGoods").text();
      goodsIndex = $(this).parent().parent().index();
      if (goodsNum > 0) {
        goodsNum += -1;
        $(this).siblings(".numGoods").text(goodsNum);
      } else {
        $(this).siblings(".numGoods").text(0);
      }
    }
  });

  $(".validateMoney .addGoods").click(function () {
    moneyNum = +$(this).siblings(".numGoods").find("span").text();
    moneyIndex = $(this).parent().parent().index();
    moneyNum += 1;
    $(this).siblings(".numGoods").find("span").text(moneyNum);


  });
  //减少物品按钮
  $(".validateMoney .reduceGoods").click(function () {
    moneyNum = +$(this).siblings(".numGoods").find("span").text();
    moneyIndex = $(this).parent().parent().index();
    if (moneyNum > 1) {
      moneyNum += -1;
      $(this).siblings(".numGoods").find("span").text(moneyNum);
    } else {
      $(this).siblings(".numGoods").find("span").text("");
    }

  });
  //图片放大
  $(".cameraImgBoxStyle").on("click", "img", function () {
    $(this).zoomify("zoom");
  })

  $(".rightNav span").click(function () {
    $(".loginOutBox").hide();
    $(".navUser").hide();
    $(".approval").hide();
    $(".login").show();
    $(".loginContent input").val('');
    loginFlag = false;
  });
  //点击取消按钮
  $(".validateListCancle").click(function () {
    uuidImgVal1 = "";
    uuidImgVal2 = '';
    uuidImgVal3 = '';
    uuidImgVal4 = '';
    approvalBtn = true;
    $(".cameraImgBox img").attr("src", "");
    getImgBtnInterval1Str = false;
    getImgBtnInterval2Str = false;
    getImgBtnInterval3Str = false;
    getImgBtnInterval4Str = false;
    $(".cameraImgBoxStyle .cameraImgText").html('');
    window.clearInterval(getImgBtnInterval1);
    window.clearInterval(getImgBtnInterval2);
    window.clearInterval(getImgBtnInterval3);
    window.clearInterval(getImgBtnInterval4);
    window.clearTimeout(getImgBtnInterval5);

  });
  //历史

})